const express = require('express')
const server = express()
const lodash = require('lodash')
const { stuNameArr } = require('./stuName.js')
server.get('/api/rand', (req, res) => {
  // console.log(stuNameArr)
  const rand = lodash.random(0, stuNameArr.length)
  // console.log(stuNameArr[rand])
  const nameList = stuNameArr[rand]
  res.send(nameList)
})

server.listen(3000, () => {
  console.log('服务器已启动')
})